﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Quartz;
using log4net;
using ihongma.Common;
namespace ihongma.Job
{
    public class job : IJob
    {
        #region IJob 成员
        private ILog logger = LogManager.GetLogger(typeof(job));
        JobCollect jobc = new JobCollect();
        Jobu148 jobu = new Jobu148();
        JobUisdc uisdc = new JobUisdc();
        JobAd ad = new JobAd();
        public void Execute(JobExecutionContext context)
        {
            try
            {
                logger.Info("索引开始");
                jobc.cnblogs(2);
                jobu.u148(2);
                uisdc.url(2, 357, "http://www.uisdc.com/category/uiicon/page/");
                uisdc.url(2, 356, "http://www.uisdc.com/category/work-blueprint/page/");
                uisdc.url(2, 355, "http://www.uisdc.com/category/books-recommend/page/");
                uisdc.url(2, 354, "http://www.uisdc.com/category/site-recommend/page/");
                uisdc.url(34, 358, "http://www.uisdc.com/category/share/page/");
                uisdc.url(10, 359, "http://www.uisdc.com/category/hot-download/page/");
                ad.adadd();
                CacheHelper.Remove("index");
                HttpRequestHelper.GetPageSourceByUrl("http://www.ihongma.com/", "utf-8");
                logger.Info("索引结束");
            }
            catch (Exception ex)
            {
                logger.Error("启动索引任务异常", ex);
            } 
            finally
            {
                HttpRequestHelper.GetPageSourceByUrl("http://www.ihongma.com/", "utf-8");
            }
        }
        public void CreateIndex()
        {
            logger.Debug("测试成功++++++++++++++===============");
        }
        #endregion
    }
}
